/*
let obj={
    a:1,
    b:2
}
console.log(obj);
console.log(obj.toString);
console.log(obj.constructor);

// for(let k in obj){
//     console.log(k)
// }

let obj1=Object.getOwnPropertyDescriptor(obj,'a');
obj1.enumerable=false;
console.log(obj1.enumerable);
for(let k in obj){
    console.log(k)
}*/


//让对象的某个属性不可枚举
function Tabs() {
    
}
Tabs.prototype={
    constructor:Tabs,
    a:1,
    run:function(){
    }
}
let tab=new Tabs();
console.log(tab.constructor);
// for(let k in tab){
//     console.log(k);
// }
Object.defineProperty(tab,'constructor',{
    enumerable:false
})
for(let k in tab){
    console.log(k);
}

let arr=[1,2,3];
console.log(arr);
arr.__proto__.aabbcc=123;
console.log(arr.aabbcc);

const o=Object.setPrototypeOf({},null);
console.log(o);

let proto={};
let obj2={x:10};
Object.setPrototypeOf(obj2,proto);
proto.y=20;
proto.z=40;
console.log(obj2);

let obj3={
    a:1,
    b:2,
    c:3
}
for(let key of Object.keys(obj3)){
    console.log(key);
}
for(let value of Object.values(obj3)){
    console.log(value);
}
for(let e of Object.entries(obj3)){
    console.log(e);
}